package com.feihao.zhou.TCP.demo01;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(11111);

        Socket socket = serverSocket.accept();

        InputStream inputStream = socket.getInputStream();

        int len ;
        byte[] bytes = new byte[1024];

        while ((len = inputStream.read(bytes))!=-1){
            System.out.println(new String(bytes,0,len));
        }
    }
}
